﻿@page "/"
@using Common;
@using Microsoft.EntityFrameworkCore
@using SingleDbSingleTable.Data
@inject ITenantService Service
@inject IDbContextFactory<ContactContext> Factory

<PageTitle>Contacts for @Service.Tenant</PageTitle>

<ContactList FetchContacts="RefreshContacts"/>

@code
{
    private List<Contact> RefreshContacts()
    {
        var list = Factory.CreateDbContext();        
        return new List<Contact>(list.Contacts);
    }
}